#ifndef Key_H
#define Key_H
#include "main.h"

#define KEY_L PA0
#define KEY_R PB2
#define KEY_A PG9
#define KEY_B PB15

typedef enum 
{
    key_Up,
    key_Down,
    key_Left,
    key_Right,
    key_Center,
    key_L,
    key_R,
    key_A,
    key_B,
    key_Num
}Key;

typedef enum 
{
    keyState_Down,
    keyState_Up
}KeyState;

typedef enum 
{
    keyEvent_Release,
    keyEvent_ReleaseOnce,
    keyEvent_Press,
    keyEvent_PressOnce,
    keyEvent_LongPress, 
    keyEvent_LongPressOnce,
    keyEvent_LongPressLoop,
}KeyEvent;



extern  u16 key_Time[key_Num];
extern KeyEvent key_Event[key_Num]; 
void Key_AddKeyState(Key key, KeyState keyState, u16 addTime);
bool Key_GetKeyEvent(Key key, KeyEvent keyEvent);

void Key_Task(void);
void Key_Init(void);



#endif
